{% extends "base_blank.volt" %}

{% block pageHeader %}
    <style type="text/css">
        .container, .container-fluid {
            min-width: 600px;
        }
    </style>
{% endblock %}

{% block pageFooter%}
    {{ javascript_include("/assets/manage/js/qaadd/answer.js", false) }}
{% endblock %}

{% block content %}
    <div class="container-fluid" id="content_box_blank">
        <div class="row">
            <div class="col-xs-12">

                <form id="form_add" class="form-horizontal" role="form" method="post" action="" target="ifr_send_file" enctype="multipart/form-data">
                    <input type="hidden" name="callback" value="parent.setFormResult">
                    <input type="hidden" name="question_id" value="{{ id }}">
                    <div class="form-group">
                        <label for="bp_is_sell" class="col-xs-2 control-label">内容</label>
                        <div class="col-xs-9">
                            <textarea class="form-control" name="answer_content" id="answer_content" rows="5" data-rule="required;"></textarea>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="answer_pic_box" class="col-xs-2 control-label">图片</label>
                        <div class="col-xs-9">
                            <div id="answer_pic_box">
                                <div class="input-group paddingTB5">
                                    <input type="file" class="form-control" name="answer_pic[]">
                                    <div class="input-group-addon bg_red cursor_pointer" onclick="$.bpPhotoDel(this)"><i class="fa fa-times"></i></div>
                                </div>
                            </div>
                            <div>
                                <p class="help-block pull-left">图片宽度750px最佳;</p>
                                <button type="button" id="but_add_photo" class="btn btn-primary btn-sm pull-right"><i class="fa fa-plus"></i></button>
                            </div>
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="bp_is_sell" class="col-xs-2 control-label">回答用户</label>
                        <div class="col-xs-9">
                            {% for d in userList %}
                            <div class="radio">
                                <label>
                                    <input type="radio" name="answer_user" value="{{ d.user_id }}" data-rule="checked;" data-target="#answer_user_error">
                                    {{ d.user_nickname }}
                                </label>
                            </div>
                            {% endfor %}
                            <div class="input-group" id="answer_user_error"></div>
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="col-xs-12 text-center">
                            <button type="submit" class="btn btn-primary"><i class="fa fa-floppy-o fa-lg"></i> 保 存</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
{% endblock %}